package com.alibaba.citrus.cr.order.open.api.facade.service.fulfillmentorder;

import com.alibaba.citrus.cr.order.open.api.facade.common.model.WmsOutBoundMessage;
import com.alibaba.citrus.cr.order.open.api.facade.model.TransferOrder;
import com.alibaba.cloud.retail.wms.api.model.orders.common.WarehousingOrderDTO;
import com.epoch.app.crunifiedinventory.model.enums.FulfillmentTypeEnum;

import java.util.Arrays;
import java.util.List;

/**
 * @description:
 * @author: yuhw
 * @date: 2024年01月25日 11:03
 **/
public abstract class TransferFulfillmentOrderHandler {

    public abstract boolean support(TransferOrder transferOrder);

    public abstract void handler(List<WarehousingOrderDTO> warehousingOrderDTOList, TransferOrder transferOrder, WmsOutBoundMessage message);

    public abstract boolean idempotent(WmsOutBoundMessage message);

    /**
     * 履约类型支持: 非外仓收货的. 即现在为大仓收货 和 虚拟移库的
     * @param transferOrder
     * @return
     */
    public boolean supportFulfillmentType(TransferOrder transferOrder){
//        return Arrays.asList(FulfillmentTypeEnum.PILOT2CURRENT,FulfillmentTypeEnum.CURRENT2CURRENT)
//                .stream().noneMatch(fulfillmentTypeEnum -> fulfillmentTypeEnum.getValue().toString().equals(transferOrder.getFulfillmentTypeCode()));
        return true;
    }
}
